﻿using System.Data;
using System.Data.SqlClient;
namespace MyWeb.Data
{
	public class tblFEEDAL : SqlDataProvider
	{

		#region[tblFEE_GetbyAll]
		public DataTable tblFEE_GetByAll()
		{
			using (var cmd = new SqlCommand("sp_tblFEE_GetByAll", GetConnection()))
			{
				cmd.CommandType = CommandType.StoredProcedure;
				return GetTable(cmd);
			}
		}
		#endregion
		#region[tblFEE_GetbyId]
		public DataTable tblFEE_GetById(string FEE_ID)
		{
			using (var cmd = new SqlCommand("sp_tblFEE_GetById", GetConnection()))
			{
				cmd.CommandType = CommandType.StoredProcedure;
				cmd.Parameters.Add(new SqlParameter("@FEE_ID", FEE_ID));return GetTable(cmd);
			}
		}
		#endregion
		#region[tblFEE_GetbyTop]
		public DataTable tblFEE_GetByTop(string Top, string Where, string Order)
		{
			using (var cmd = new SqlCommand("sp_tblFEE_GetByTop", GetConnection()))
			{
				cmd.CommandType = CommandType.StoredProcedure;
				var da = new SqlDataAdapter(cmd);
				cmd.Parameters.Add(new SqlParameter("@Top",Top));
				cmd.Parameters.Add(new SqlParameter("@Where",Where));
				cmd.Parameters.Add(new SqlParameter("@Order",Order));
				return GetTable(cmd);
			}
		}
		#endregion
		#region[tblFEE_GetbySTUDENT_ID]
		public DataTable tblFEE_GetBySTUDENT_ID(string STUDENT_ID)
		{
			using (var cmd = new SqlCommand("sp_tblFEE_GetBySTUDENT_ID", GetConnection()))
			{
				cmd.CommandType = CommandType.StoredProcedure;
				cmd.Parameters.Add(new SqlParameter("@STUDENT_ID", STUDENT_ID));
				var da = new SqlDataAdapter(cmd);
				var dt = new DataTable();
				da.Fill(dt);
				return dt;
			}
		}
		#endregion
		#region[tblFEE_Insert]
		public void tblFEE_Insert(tblFEEInfo Data)
		{
			using (var cmd = new SqlCommand("sp_tblFEE_Insert", GetConnection()))
			{
				cmd.CommandType = CommandType.StoredProcedure;
				cmd.Parameters.Add(new SqlParameter("@FEE_ID", Data.FEE_ID));
				cmd.Parameters.Add(new SqlParameter("@FEE_NOTE", Data.FEE_NOTE));
				cmd.Parameters.Add(new SqlParameter("@STUDENT_ID", Data.STUDENT_ID));
				cmd.Parameters.Add(new SqlParameter("@DATE_AMOUNT", Data.DATE_AMOUNT));
				cmd.Parameters.Add(new SqlParameter("@TUTITON_FEE", Data.TUTITON_FEE));
				cmd.Parameters.Add(new SqlParameter("@REMAIN_FEE", Data.REMAIN_FEE));
				cmd.Parameters.Add(new SqlParameter("@STATUS", Data.STATUS));
				cmd.Parameters.Add(new SqlParameter("@CREATOR", Data.CREATOR));
				cmd.Parameters.Add(new SqlParameter("@CREATED_DATE", Data.CREATED_DATE));
				ExeCuteNonquery(cmd);
			}
		}
		#endregion
		#region[tblFEE_Update]
		public void tblFEE_Update(tblFEEInfo Data)
		{
			using (var cmd = new SqlCommand("sp_tblFEE_Update", GetConnection()))
			{
				cmd.CommandType = CommandType.StoredProcedure;
				cmd.Parameters.Add(new SqlParameter("@FEE_ID", Data.FEE_ID));
				cmd.Parameters.Add(new SqlParameter("@FEE_NOTE", Data.FEE_NOTE));
				cmd.Parameters.Add(new SqlParameter("@STUDENT_ID", Data.STUDENT_ID));
				cmd.Parameters.Add(new SqlParameter("@DATE_AMOUNT", Data.DATE_AMOUNT));
				cmd.Parameters.Add(new SqlParameter("@TUTITON_FEE", Data.TUTITON_FEE));
				cmd.Parameters.Add(new SqlParameter("@REMAIN_FEE", Data.REMAIN_FEE));
				cmd.Parameters.Add(new SqlParameter("@STATUS", Data.STATUS));
				cmd.Parameters.Add(new SqlParameter("@CREATOR", Data.CREATOR));
				cmd.Parameters.Add(new SqlParameter("@CREATED_DATE", Data.CREATED_DATE));
				ExeCuteNonquery(cmd);
			}
		}
		#endregion
		#region[tblFEE_Delete]
		public void tblFEE_Delete(string FEE_ID)
		{
			using (var cmd = new SqlCommand("sp_tblFEE_Delete", GetConnection()))
			{
				cmd.CommandType = CommandType.StoredProcedure;
				cmd.Parameters.Add(new SqlParameter("@FEE_ID",FEE_ID));
				ExeCuteNonquery(cmd);
			}
		}
		#endregion
	}
}